package java1021;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Vip v = new Vip();
        v.vname = "安徽大唐";
        v.address = "合肥";
        int choice=0;
        for (;;){
            System.out.println("0.添加员工   1.添加积分   2.积分兑换礼品  3.会员信息查询");
            System.out.print("请选择：");
            choice = input.nextInt();
            if (choice==0){
                Member me = new Member();
                System.out.println("请输入会员号：");
                me.vipnum = input.nextInt();
                System.out.println("请输入会员姓名：");
                me.name = input.next();
                System.out.println("请输入会员手机号：");
                me.phonenum = input.next();
                System.out.println("请输入会员积分：");
                me.integral = input.nextInt();
                boolean b = v.add(me);
                if (b){
                    System.out.println("添加成功");
                }else{
                    System.out.println( "添加失败");
                }

            }
            if (choice==1){
                System.out.println("请输入要添加积分的会员号：");
                int vipnum = input.nextInt();
                System.out.println( "请输入要添加积分的数量");
                int integral = input.nextInt();
                boolean b = v.inc(vipnum, integral);
                if (b){
                    System.out.println("添加成功");
                }else{
                    System.out.println( "添加失败");
                }
            }
            if (choice==2){
                System.out.println("请输入需要兑换的会员号：");
                int vipnum = input.nextInt();
                System.out.println("请输入想要兑换的奖品序号:\n1：100分兑换餐巾纸一包 \n2:400分兑换剃须刀一把 \n3：1000分兑换炒锅一个");
                int giftnum = input.nextInt();
                System.out.println(v.exchange(vipnum,giftnum));
            }
            if (choice==3){
                v.printInfor();
            }
        }

    }
}
